<?php
/* @var $this RoleSourceController */
/* @var $model RoleSource */

$this->breadcrumbs = array(
    '系统资源管理' => array('admin'),
    '列表',
);

$this->menu = array(
    array('label' => '列表', 'url' => array('admin')),
    array('label' => '添加', 'url' => array('create')),
);

Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});
$('.search-form form').submit(function(){
	$.fn.yiiGridView.update('role-source-grid', {
		data: $(this).serialize()
	});
	return false;
});
");
?>

<h1>访问资源管理</h1>

<div class="search-form" style="display:none">
    <?php
    $this->renderPartial('_search', array(
        'model' => $model,
    ));
    ?>
</div><!-- search-form -->

<?php
$this->widget('zii.widgets.grid.CGridView', array(
    'id' => 'role-source-grid',
    'dataProvider' => $model->search(),
    'filter' => $model,
    'columns' => array(
        'id',
        'pid',
        'source_value',
        'source_name',
        array(
            'class' => 'CButtonColumn',
        ),
    ),
));
?>
